<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">

<script language="text/javascript" src="scripts/Calendar.js"></script> 

<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
    <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
    <link rel="stylesheet" href="./css/style.css" type="text/css">
    
     <script src="Scripts/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui-1.8.13.custom.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.validate.wrapper.js" type="text/javascript"></script>
    
    <script> 		   		
    		$(document).ready(function()
    		{
    		    $("#FromDate").datepicker({
    		    	minDate: 0,
    		    	numberOfMonths: 1,
    		    	dateFormat: 'yy-mm-dd', 
    		        onSelect: function(selected) 
    		        {
    		        	$("#ToDate").datepicker("option","minDate", selected);
    		        }
    		    
    		       });
    		    
    		    $("#ToDate").datepicker({ 
    		    	numberOfMonths: 1,
    		      dateFormat: 'yy-mm-dd', 
    		        onSelect: function(selected) 
    		        {
    		           /*  $("#FromDate").datepicker({minDate:0}); */
    		            $("#FromDate").datepicker("option","maxDate", selected);
    		        }
    		    });  
    		});
    </script>	
<title>Make A Booking</title>
</head>
<body>
<%@ include file="header.jsp" %>
<table>
<tr>
<td width=15%></td>
<td class="menuborder" width=20%>
<c:if test="${sessionScope.roleUser=='Admin'}">
	<table id="head">
			<tr>
<!-- 				<td><h2 id="header">ISS Facilities Booking</h2></td> -->
				<td>
<!-- 				<input type="hidden" name="welcome" id="show_greeting" /> -->
				<c:if test="${!empty sessionScope.LoggedinUser.username}">
				<h5>Welcome ${sessionScope.LoggedinUser.username}</h5>
				</c:if>
				</td>
			</tr>
		</table>
		<table id="content">
			<tr>
				<td><h2 id="header">MENU</h2></td>
			</tr>
			<tr>
				<td><a href="MakeABooking.jsp">Make a Booking</a></td>
			</tr>
			<tr>
				<td><a href="BookDetailsController">View Booking Details</a></td>
			</tr>
			<tr>
				<td><a href="BookingHistoryController">View Booking History</a></td>
			</tr>
			<tr>
				<td><a href="ManageStaff.jsp">Manage Staff</a></td>
			</tr>
			<tr>
				<td><a href="LoadFacility">Manage Facilities</a></td>
			</tr>
			<tr>
				<td><a href="Login.jsp">Sign Out</a>
				</td>
			</tr>
		</table>
	</c:if>
	<c:if test="${sessionScope.roleUser=='Manager'}">
	<table id="head">
			<tr>
			<td>
				<c:if test="${!empty sessionScope.LoggedinUser.username}">
					<h5>Welcome ${sessionScope.LoggedinUser.username}</h5>
				</c:if>
			</td>
			</tr>
		</table>
		<table id="content">
			<tr>
				<td><h2 id="header">MENU</h2></td>
			</tr>
			<tr>
				<td><a href="MakeABooking.jsp">Make a Booking</a></td>
			</tr>
			<tr>
				<td><a href="BookDetailsController">View Booking Details</a></td>
			</tr>
			<tr>
				<td><a href="BookingHistoryController">View Booking History</a></td>
			</tr>
			<tr>
				<td><a href="ReviewController">Review Booking</a></td>
			</tr>
			<tr>
				<td><a href="Login.jsp">Sign Out</a></td>
			</tr>
		</table>
	</c:if>
	<c:if test="${sessionScope.roleUser=='Staff'}">
		<table id="head">
			<tr>
<!-- 				<td><h2 id="header">ISS Facilities Booking</h2></td> -->
				<c:if test="${!empty sessionScope.LoggedinUser.username}">
					<h5>Welcome ${sessionScope.LoggedinUser.username}</h5>
				</c:if>
			</tr>
			<tr></tr>
		</table>
		<table id="content">
			<tr></tr>
			<tr></tr>
			<tr>
				<td><h2 id="header">MENU</h2></td>
			</tr>
			<tr>
				<td><a href="MakeABooking.jsp">Make a Booking</a></td>
			</tr>
			<tr>
				<td><a href="BookDetailsController">View Booking Details</a></td>
			</tr>
			<tr>
				<td><a href="BookingHistoryController">View Booking History</a></td>
			</tr>
			<tr>
				<td><a href="Login.jsp">Sign out</a></td>
			</tr>
		</table>
</c:if>
</td>
<td width=55%>
<form action="/JavaCA/MakeABookingTypeFilter" method="get" >
<% String bbid=request.getParameter("bbid");
request.getSession().setAttribute("liuruigege", bbid); %>

Facility Type: <select name="type"  id="type" onchange="location.href='MakeABookingTypeFilter?type=' + this.value;" >
 <option value="Auditorium" ${ param['type'] == "Auditorium" ? 'selected="selected"' : '' }> Auditorium</option>
  <option value="MPH" ${ param['type'] == "MPH" ? 'selected="selected"' : '' }>MPH</option>
  <option value="DiscussionRoom" ${ param['type'] == "DiscussionRoom" ? 'selected="selected"' : '' }>DiscussionRoom</option>
  <option value="ClassRoom" ${ param['type'] == "ClassRoom" ? 'selected="selected"' : '' }>ClassRoom</option>
  <option value="MeetingRoom" ${ param['type'] == "MeetingRoom" ? 'selected="selected"' : '' }>MeetingRoom</option>
</select><br><br>

</form>

<form action="/JavaCA/MakeABookingDateFilter" id="FormToValidate" method="get">
<input type="hidden" name="bbid" value="${param.bbid}">
Available Facilities : <br>
<table cellspacing="6" cellpadding="2" border="1"  >
       <tr>
       <th align="center" bgcolor="EBE8E9">FacilityName</th>
       <th align="center" bgcolor="EBE8E9">FacilityID</th>       
       <th align="center" bgcolor="EBE8E9">Type</th>
       <th align="center" bgcolor="EBE8E9">Description</th>
       <th align="center" bgcolor="EBE8E9">Capacity</th>
       </tr>
     <c:forEach var="fa" items="${List}">
        <tr>
            
            <td><input type="radio" id="facName" name="facName" value="${fa.facilityName}" >${fa.facilityName}</td>
            <td align="center">${fa.facilityID}</td>          
            <td align="center">${fa.type}</td>
            <td align="center">${fa.description}</td>
            <td align="center">${fa.capacity}</td>
<!--             <td><input type="radio" name="check" value="" ></td>    -->       
        </tr>
    </c:forEach>
</table>
<br><br>

FromDate:
 <input type="text" id="FromDate" name="fDate" onSelect="location.href='UpdateBooking?fromDate'+this.value;"/>
<br><br>
ToDate:
 <input type="text" id="ToDate" name="tDate" onSelect="location.href='UpdateBooking?toDate'+this.value;"/>
<br><br>


Priority: <select id="priority" name="priorityvalue">
  <option value="High">High</option>
  <option value="Medium">Medium</option>
  <option value="Low">Low</option>
</select>
<br><br>
Reason:<br><textarea name="reasonvalue" cols="30" rows="4"></textarea>
<br><br>
Emergency:
<input type="checkbox" name="emergencyvalue" value="Y">
 <br><br>
<input type="submit" value="Update" id="btnValidate">
</form>
<c:if test="${not empty '${Message}'}">
	<h3 ><c:out value="${Message}"/></h3>
</c:if>
</td>
<td width=10%></td>
</tr>
</table>
<%@ include file="footer.jsp" %>
</body>
</html>